package com.job.shuang.HomeWork0705;

import java.util.concurrent.atomic.AtomicBoolean;

/**
 * @author liushuang
 * @version 1.0
 * @since 2022-07-06 09:50:27
 */
public class Chicken0705 {
    public static void main(String[] args) {
        int count = 0;
        for (int cock=0;cock<=20;cock++){
            for (int hen=0;hen<=33;hen++){
                for (int chick=0;chick<=100;chick++){
                    if (chick%3==0){
                        if ((cock+hen+chick==100)&&(cock*5+hen*3+chick/3==100)){
                            count++;
                            System.out.println("公鸡有："+cock+" 母鸡有："+hen+" 小鸡仔有："+chick);
                        }
                    }
                }
            }
        }
        System.out.println("一共有"+count+"种买法");
    }
}
